package com.vm.osm.business.dto.rsp.logic_node;

import com.google.common.base.MoreObjects;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 逻辑节点树
 *
 * @author Xuerong Xue
 */
@Data
public class LogicNodeDetail implements Serializable {
    @ApiModelProperty(value = "节点Id")
    private String id;
    @ApiModelProperty("节点名称")
    private String node_name;
    @ApiModelProperty("节点编码")
    private String node_code;
    @ApiModelProperty("节点类型Id")
    private String type_id;
    @ApiModelProperty("行业Id")
    private String industry_id;
    @ApiModelProperty("属性列表")
    private List<AttrItem> attrs;

    @Data
    public static class AttrItem {
        @ApiModelProperty("属性Id")
        private String attr_id;
        @ApiModelProperty("属性值")
        private String attr_val;

        @Override
        public String toString() {
            return MoreObjects.toStringHelper(this)
                    .add("attr_id", attr_id)
                    .add("attr_val", attr_val)
                    .toString();
        }
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("id", id)
                .add("node_name", node_name)
                .add("node_code", node_code)
                .add("type_id", type_id)
                .add("industry_id", industry_id)
                .add("attrs", attrs)
                .toString();
    }
}
